package org.example.projecttwo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.FieldFill;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 评论表
 * </p>
 *
 * @author nn
 * @since 2025-11-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("comment")
@Schema(name="Comment对象", description="评论表")
public class Comment implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "主键ID")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @Schema(description = "评论编号")
    @TableField("comment_no")
    private String commentNo;

    @Schema(description = "内容类型")
    @TableField("content_type")
    private Integer contentType;

    @Schema(description = "内容ID")
    @TableField("content_id")
    private Long contentId;

    @Schema(description = "父评论ID")
    @TableField("parent_id")
    private Long parentId;

    @Schema(description = "根评论ID")
    @TableField("root_id")
    private Long rootId;

    @Schema(description = "评论层级")
    @TableField("comment_level")
    private Integer commentLevel;

    @Schema(description = "评论内容")
    @TableField("content")
    private String content;

    @Schema(description = "评论者ID")
    @TableField("user_id")
    private Long userId;

    @Schema(description = "评论者昵称")
    @TableField("user_nickname")
    private String userNickname;

    @Schema(description = "评论者头像")
    @TableField("user_avatar")
    private String userAvatar;

    @Schema(description = "点赞数")
    @TableField("like_count")
    private Integer likeCount;

    @Schema(description = "回复数")
    @TableField("reply_count")
    private Integer replyCount;

    @Schema(description = "评论时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


}